/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package clases.pe.edu;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import pe.edu.ulima.bean.Cliente;
import pe.edu.ulima.bean.Comprobante;
import pe.edu.ulima.bean.Empleado;
import pe.edu.ulima.bean.Producto;
import pe.edu.ulima.bean.Proveedor;

/**
 *
 * @author Evelin
 */
@WebService(serviceName = "WSCarniceria")
public class WSCarniceria {
    CarniceriaDAO dao = new CarniceriaDAO();

    /**
     * Web service operation
     */
    @WebMethod(operationName = "calcularStockProducto")
    public Float calcularStockProducto(@WebParam(name = "codProdParam") int codProdParam) {
        //TODO write your implementation code here:
        float num = dao.calcularStockProducto(codProdParam);
        return num;
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getProductos")
    public List<Producto> getProductos() {
        //TODO write your implementation code here:
        List<Producto> prods = dao.getProductos();
        return prods;
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getVentas")
    public List<Comprobante> getVentas() {
        //TODO write your implementation code here:
        List<Comprobante> comps = dao.getVentas();
        return comps;
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getClientes")
    public List<Cliente> getClientes() {
        //TODO write your implementation code here:
        List<Cliente> clis = dao.getClientes();
        return clis;
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getEmpleados")
    public List<Empleado> getEmpleados() {
        //TODO write your implementation code here:
        List<Empleado> emps = dao.getEmpleados();
        return emps;
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getVentasxFechas")
    public List<Comprobante> getVentasxFechas(@WebParam(name = "fecha1Param") Date fecha1Param, @WebParam(name = "fecha2Param") Date fecha2Param) {
        //TODO write your implementation code here:
        List<Comprobante> comps = dao.getVentasxFechas(fecha1Param, fecha2Param);
        return comps;
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "calcularStocksxFechas")
    public List<String> calcularStocksxFechas(@WebParam(name = "fecha1Param") Date fecha1Param, @WebParam(name = "fecha2Param") Date fecha2Param) {
        //TODO write your implementation code here:
        List<String> stocks = dao.calcularStocksxFechas(fecha1Param, fecha2Param);
        return stocks;
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getProducto")
    public Producto getProducto(@WebParam(name = "codParam") int codParam) {
        //TODO write your implementation code here:
        Producto prod = dao.getProducto(codParam);
        return prod;
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getCliente")
    public Cliente getCliente(@WebParam(name = "codParam") int codParam) {
        //TODO write your implementation code here:
        Cliente cli = dao.getCliente(codParam);
        return cli;
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getEmpleado")
    public Empleado getEmpleado(@WebParam(name = "codParam") int codParam) {
        //TODO write your implementation code here:
        Empleado emp = getEmpleado(codParam);
        return emp;
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getProveedor")
    public Proveedor getProveedor(@WebParam(name = "codParam") int codParam) {
        //TODO write your implementation code here:
        Proveedor prov = getProveedor(codParam);
        return prov;
    }
}
